package com.heima.controller;

import com.heima.domain.pojo.Result;
import com.heima.domain.pojo.Work;
import com.heima.service.WorkService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/work")
public class WorkController {
    @Autowired
    private WorkService workService;

    @GetMapping
    public Result getList(){
        List<Work> workList = workService.list();
        return Result.success(workList);
    }
}
